package designpattern.decorate.flavour;

import designpattern.decorate.coffee.Coffee;

/*
    调料：装饰者
 */
public abstract class Flavour extends Coffee{
    private Coffee coffee;

    public Flavour() {
    }

    public Flavour(Coffee coffee) {
        this.coffee = coffee;
    }

    public Coffee getCoffee() {
        return coffee;
    }

    public void setCoffee(Coffee coffee) {
        this.coffee = coffee;
    }

    @Override
    public float cost() {
        return coffee.cost()+getPrice();
    }

    @Override
    public String getDec() {
        return super.getDec()+"+"+coffee.getDec();
    }
}
